home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 2
/
AACD 2.iso
/
AACD
/
WebSites
/
MailingLists
/
AMOSLIST.0799
/
000190_nobody_Sat Jul 31 16:24:53 1999.msg
< prev
next >
Wrap
Internet Message Format
|
1999-08-02
|
3KB
Received: from onelist.com (pop.onelist.com [209.207.164.229])
by osf1.gmu.edu (8.8.8/8.8.8) with SMTP id QAA09367
for <mcox4@osf1.gmu.edu>; Sat, 31 Jul 1999 16:24:45 -0400 (EDT)
Received: (qmail 22512 invoked by alias); 31 Jul 1999 20:25:18 -0000
Received: (qmail 22473 invoked from network); 31 Jul 1999 20:25:18 -0000
Received: from unknown (HELO web904.mail.yahoo.com) (128.11.23.79) by pop.onelist.com with SMTP; 31 Jul 1999 20:25:18 -0000
Message-ID: <19990731202425.9895.rocketmail@web904.mail.yahoo.com>
Received: from [62.188.142.80] by web904.mail.yahoo.com; Sat, 31 Jul 1999 21:24:25 BST
Date: Sat, 31 Jul 1999 21:24:25 +0100 (BST)
From: =?iso-8859-1?q?Claude=20Heiland-Allen?= <cheilandallen@yahoo.co.uk>
To: amos-list@onelist.com
Mailing-List: list amos-list@onelist.com; contact amos-list-owner@onelist.com
Delivered-To: mailing list amos-list@onelist.com
Precedence: bulk
List-Unsubscribe: <mailto:amos-list-unsubscribe@ONElist.com>
Reply-to: amos-list@onelist.com
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Subject: Re: [amos-list] 2nd mouse & Floating point
Status: O
X-Status:
From: =?iso-8859-1?q?Claude=20Heiland-Allen?= <cheilandallen@yahoo.co.uk>
--- Leto Kauler <letok@netspace.net.au> wrote:
> Also, I found on Aminet a doc on optimising AMOS
> code. One
> suggestion was that floating point calculations,
> which is supposed
> involved with arrays like: PLAYER#() are _very_
> slow. I've been
> using these arrays heaps in my new tank code! I can
> not afford
> for the game to be slow. What do other people know
> about this?
Floating point numbers are very slow (unless you have
an FPU). Especially double precision. Fixed point
numbers are really integers manipulated in a cunning
way. The basic idea is the same as using pence
instead
of pounds in a money calculation.
Here are the simple rules:
addition/subtraction: same as for integers
x*k + y*k = z*k
multiplication: multiply, then divide by magic
constant
(x*k * y*k)/k = z*k
division: multiply top by magic constant, then divide
(x*k * k) / y*k = z*k
If you use 256 as a magic constant, then you can use
shift operations. I wrote some assembly language
stuff to do this quickly, I wouldn't know how to link
it in with AMOS though. I can post it to the list if
you want.
Claude
_____________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
--------------------------- ONElist Sponsor ----------------------------
ONElist: your connection to like-minds and kindred spirits.
------------------------------------------------------------------------
Official AMOS WWW: http://members.xoom.com/AmosFactory/front.html